package org.scc.model;

import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * 文章
 * 包含 标题、内容、发表日期、文章类型和作者
 * @author rzpeng
 *
 */
public class Article {
	private int id;
	private String title;
	private String content;
	private Date date;
	
	/**
	 * 首页是否展示
	 */
	private boolean showIndex;
	
	private ArticleType articleType;
	private User author;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public ArticleType getArticleType() {
		return articleType;
	}
	public void setArticleType(ArticleType articleType) {
		this.articleType = articleType;
	}
	public User getAuthor() {
		return author;
	}
	public void setAuthor(User author) {
		this.author = author;
	}
	
	public String getDateText(SimpleDateFormat sdf){
		return sdf.format(date);
	}
	public boolean isShowIndex() {
		return showIndex;
	}
	public void setShowIndex(boolean showIndex) {
		this.showIndex = showIndex;
	}
	
}
